n=5
m=[]
for i in range(0,n):
    a=[]
    for j in range(0,n):
        a.append(0)
        m.append(a)
left_top=0
right_buttom=n-1
number=10
while left_top<right_buttom:
    i=left_top
    while i<right_buttom:
        m[left_top][i]=number
        i+=1
        number+=10
    i=left_top
    while i<right_buttom:
        m[i][right_buttom]=number
        i+=1
        number+=10
    i=right_buttom
    while i>left_top:
        m[right_buttom][i]=number
        i-=1
        number+=10
    i=right_buttom
    while i>left_top:
        m[i][left_top]=number
        i-=1
        number+=10
left_top+=1
right_buttom-=1
if( n%2 !=0):
    m[n//2][n//2]=n*n*10